def to_bool(o):
    if o:
        return True
    else:
        return False

# 数字0为false，其他均为true（包括负数）
a, b = 0, 10
print("a, b = ", a, ", ", b, sep="")
print("a and b ==>", a and b, (to_bool(a and b)))
print("a or b ==>", a or b, (to_bool(a or b)))
print("not a ==>", not a, (to_bool(not a)))
print()
# 字符串空串为false，其他均为true（包括空格字符串）
a, b = "", "123"
print("a, b = ", a, ", ", b, sep="")
print("a and b ==>", a and b, (to_bool(a and b)))
print("a or b ==>", a or b, (to_bool(a or b)))
print("not a ==>", not a, (to_bool(not a)))
print()
a, b = False, True
print("a, b = ", a, ", ", b, sep="")
print("a and b ==>", a and b)
print("a or b ==>", a or b)
print("not a ==>", not a)
